lucky.define(['jquery','maxlength'],function(exports){
    "use strict";
    var maxlength = lucky.maxlength,
        MOD_NAME = "form", ELEMENT = ".form";

    var Form = function(){

    };

    //表单组件渲染
    Form.prototype.render = function (type) {
        var that = this,
            elementForm = $(ELEMENT);
        var elementItems  = {
            maxlength: function () {
                //渲染表单
                maxlength.render(ELEMENT);
            }
        };
        type ? (elementItems[type] ? elementItems[type]() : lucky.error("不支持的" + type + "表单元素渲染")) : $.each(elementItems, function (index,item) {
           item();
        });
        return that;
    };

    var form = new Form();
    form.render();

    exports(MOD_NAME, form);
});